<?php
declare(strict_types=1);

namespace app\common\model;

use think\Model;

class DictItemLang extends Model
{
    protected $pk = 'item_lang_id';
    
    // 自动时间戳字段
    protected $createTime = 'create_time';
    protected $updateTime = 'update_time';
    protected $autoWriteTimestamp = true;
    
    // 字段类型转换
    protected $type = [
        'item_id' => 'integer',
        'language_id' => 'integer'
    ];

    /**
     * 关联语言表
     */
    public function language()
    {
        return $this->belongsTo(Language::class, 'language_id', 'language_id');
    }
} 